-
Notifications
You must be signed in to change notification settings - Fork 282
Provide Icinga to ipl/web behaviors
#5238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
6cbb1ee to
80eb42d
Compare
public/js/icinga.js
Outdated
| return false; | ||
| } | ||
|
|
||
| define('Icinga', [], () => Icinga); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I struggle to find a suitable location when to define Icinga. This is too early. At the end, it's too late. Right before the behavior initialization, it's somewhat arbitrary...
So, looking at this from another angle, I'd propose to solve this differently:
The linked PR in ipl-web only requires this because it needs Icinga.EventListener. So why don't we define just this class? In eventlistener.js, at the end of the factory: define("icinga/legacy-app/EventListener", [], () => EventListener)
Why icinga/legacy-app/? icinga/ is the global namespace. legacy-app/ is the library name. The reason for legacy- is that I don't want to use up just app/ at this time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed offline, added define("icinga/legacy-app/Icinga", [], () => Icinga);. This must be added at least before the behaviors are initialized.
library/Icinga/Web/JavaScript.php
Outdated
| $dependencies = $match[2] ? Json::decode($match[2]) : []; | ||
| foreach ($dependencies as &$dependencyName) { | ||
| if ($dependencyName === 'exports') { | ||
| if ($dependencyName === 'exports' || $dependencyName === 'Icinga') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just check whether the name already begins with icinga/legacy-app/.
80eb42d to
f985573
Compare
17e6c35 to
923d7d9
Compare
923d7d9 to
476503f
Compare
cb16b96 to
6e495f6
Compare
6e495f6 to
51fde7f
Compare
No description provided.